package zxy_eatFood;

import java.util.Random;

public class Grid {
    private int x;  //格子x轴坐标
    private int y;  //格子y轴坐标
    Random r = new Random();  //随机食物坐标

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }


    public Grid(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public Grid() {
    }

    /**
     * 随机食物的x,y坐标
     */
    public void randomXY() {
        x = r.nextInt(58) * 10; //0-570
        y = r.nextInt(35) * 10 + 1; //1-351
    }
}
